#ifndef _TSERVER_H_
#define _TSERVER_H_
#include "TSocket.h"
#include "TEventLoop.h"
#include "TThreadPool.h"
#include "TNoCopyable.h"
class TServer : TNoCopyable
{
    //friend class TEventLoop;
public:
    TServer();
    virtual ~TServer();

    void Start(char* host, int port);

    virtual void OnConn(TSocket* sock);
    virtual void OnRecv(TSocket* sock);
    virtual void OnSend(TSocket* sock);
    virtual void OnClose(TSocket* sock);

	void PreRecv(TSocket* sock);
private:
    TSocket serSock_;
    TEventLoop eventLoop_[4];
    TThreadPool ioThreadPool;
    TThreadPool bsThreadPool;
};


#endif